import pygame,random,math,datetime
              
def record_del(filename):
        name=str(filename)+".txt"
        with open(name,"w") as write_data:
                write_data.write("")
def record(filename,string):
        name=str(filename)+".txt"
        with open(name,"a") as write_data:
                write_data.writelines(str(string)+"\n")


class bug(object):
    """Generic bug handler"""
    def __init__(self,error_type="null"):
        ##will record to "error_null.txt" unless error_type is specified
        self.type=error_type
        self.now = datetime.datetime.now()
    def bug_record(self,message,urgency=0):
        filename="Error_"+str(self.type)
        record(filename,"["+str(urgency)+"] "+str(self.now.strftime("%d-%m-%Y AT %H:%M:%S \t \t"))+str(message))
        print "record successful:  recorded to\t",filename+".txt"


